package model

import "gorm.io/gorm"

type User struct {
	gorm.Model
	UserName string `gorm:"type:varchar(30);not null;commit:用户名"`
	Password string `gorm:"type:varchar(30);not null;commit:密码"`
}

type Friend struct {
	gorm.Model
	UserId     int `gorm:"type:int;not bull;commit:用户Id"`
	CustomerId int `gorm:"type:int;not bull;commit:客服Id"`
	Status     int `gorm:"type:int;not bull;commit:0:待处理,1:已同意,2:已拒绝"`
}

type Course struct {
	gorm.Model
	UserId int    `gorm:"type:int;not bull;commit:用户Id"`
	Name   string `gorm:"type:varchar(30);not null;commit:课程名称"`
	Next   string `gorm:"type:varchar(225);not null;commit:课程内容"`
}

func (c *Course) CourseAdd(DB *gorm.DB) error {
	err := DB.Create(&c).Error
	return err
}

func (c *Course) CourseShow(DB *gorm.DB) error {
	err := DB.Create(&c).Error
	return err
}
